package com.gt.quality.config.utils;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 用户状态
 *
 * @author ruoyi
 */
@Getter
@AllArgsConstructor
public enum UserStatus {
    /**
     * 正常
     */
    OK("1", "正常", true),
    /**
     * 停用
     */
    DISABLE("0", "停用", false),
    /**
     * 删除
     */
    DELETED("2", "删除", false);

    private final String code;

    private final String info;

    private final Boolean status;


    public static UserStatus buildStatusInfo(String code) {
        UserStatus[] values = UserStatus.values();
        for (UserStatus value : values) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return DELETED;
    }


}
